<template>
	<view>
		<web-view :src="src"></web-view>
		<u-popup v-model="show" border-radius='14' mode="center"  width="500rpx" height="250rpx">
			<view class="pop-box">
				<view>提示</view>
				<view>
					点击右上角“...”打开浏览器，下载视频。
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				src: '',
				show:false
			}
		},
		onLoad(op) {
			uni.hideLoading()
			let that = this
			that.src = op.src
			that.show = that.isWeiXinLogin()
			// if (this.isWeiXinLogin) {
			// 	this.show = true
			// 	// uni.showToast({
			// 	// 	title: '点击右上角“...”打开浏览器，下载视频',
			// 	// 	icon: 'none',
			// 	// 	duration: 10000
			// 	// })
			// 	// uni.showModal({
					
			// 	// })
			// }

		},
		methods: {
			isWeiXinLogin() {
				var ua = window.navigator.userAgent.toLowerCase();
				if (ua.match(/MicroMessenger/i) == 'micromessenger') {
					return true; // 微信中打开
				} else {
					return false; // 普通浏览器中打开
				}
			},
		}
	}
</script>

<style lang="scss">
	.pop-box{
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		
		>view:nth-child(1){
			padding: 20rpx 0;
			font-size: 36rpx;
			font-weight: bold;
		}
		
		>view:nth-child(2){
			padding: 10rpx 20rpx;
			font-size: 30rpx;
			align-items: center;
		}
	}
</style>